﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Design;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Sample.Novel.EntityFrameworkCore
{
    public class NovelContextFactory : IDesignTimeDbContextFactory<NovelDbContext>
    {
        public NovelDbContext CreateDbContext(string[] args)
        {
            var optionsBuilder = new DbContextOptionsBuilder<NovelDbContext>();
            optionsBuilder.UseSqlServer("Server=.\\SqlExpress;Database=Novel;User Id=sa;Password=123456");

            return new NovelDbContext(optionsBuilder.Options);
        }
    }
}
